import React, { useCallback, useEffect, useRef, useState } from 'react'

function Swiper_two(props: any) {
  const [list, setlist] = useState([])
  useEffect(() => {
    setlist(props.lists)
    // console.log(list)
  }, [])
  const ref = useRef<HTMLVideoElement>(null)
  const videoMouse = useCallback(() => {
    if (ref.current === undefined) {
      return;
    }
    ref.current?.play();
  }, []);
  const videoMouseus = useCallback(() => {
    if (ref.current === undefined) {
      return;
    }
    ref.current?.pause();
  }, []);
  return (
    <div onMouseEnter={videoMouse} onMouseLeave={videoMouseus}>
      <video muted src={list} ref={ref}></video>
    </div>
  )
}

export default Swiper_two
